package br.edu.fanor.esfinge.dao.impl;

import javax.ejb.Stateless;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;

import br.edu.fanor.esfinge.dao.ResumoDAO;
import br.edu.fanor.esfinge.entity.Resumo;

@Stateless(mappedName="ejb/ResumoDAO")
public class ResumoDAOImpl implements ResumoDAO {

	@PersistenceContext
	public EntityManager emr;
	
	@Override
	public Resumo inserir(Resumo resumo) {
		emr.persist(resumo);
		return resumo;
	}

	@Override
	public Resumo buscarId(long id) {
		return emr.find(Resumo.class, id);
	}

	@Override
	public void remover(Resumo resumo) {
		emr.remove(resumo);
		
	}

}
